public class TestDemo3 {
    public static void main(String[] args) {
        System.out.println("求和结果"+sum());
    }
    public static int sum(){
        int n=0;
        for (int i=1;i<=1000;i++){
            n+=i;
        }
        return n;
    }
}
